Skip to content

Fix sticky Shift when handwriting view is hidden#194

Merged
LeanBitLab merged 1 commit into
LeanBitLab:mainfrom
AsafMah:fix/upstream-handwriting-shift-release
Jun 22, 2026
Merged

Fix sticky Shift when handwriting view is hidden#194
LeanBitLab merged 1 commit into
LeanBitLab:mainfrom
AsafMah:fix/upstream-handwriting-shift-release

Conversation

@AsafMah

@AsafMah AsafMah commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #186.

The v3.8.6 handwriting integration stops the handwriting view on every main-keyboard frame switch:

mHandwritingView.setVisibility(View.GONE);
mHandwritingView.stopHandwriting();

stopHandwriting() closes the handwriting bottom-row keyboard (bottomRowKeyboard.closing()), which calls MainKeyboardView.cancelAllOngoingEvents() and globally cancels active PointerTrackers. When the user taps Shift, the keyboard switches to the manual-shift layout while the Shift pointer is still down; the unconditional handwriting cleanup cancels that Shift pointer before its ACTION_UP is delivered. The Shift state remains PRESSING/CHORDING, so typing stays uppercase until the keyboard is reset.

Only stop the handwriting view when it is actually shown. If it is already hidden, just keep it hidden without closing its bottom-row keyboard / cancelling global pointer trackers.

Verification

  • Reproduced on the downstream merged debug build with diagnostic logs: Shift press reached KeyboardState, then PointerTrackerQueue.cancelAllPointerTrackers() cancelled the Shift pointer before release; subsequent letters arrived with Shift in CHORDING state.
  • Applied this exact one-line guard in the downstream merge branch and installed the debug build; Shift now returns to lowercase after the first typed letter.
  • ./gradlew.bat compileStandardRunTestsKotlin --no-daemon --console=plain passes on this upstream-based branch (with ANDROID_HOME=C:\Android\Sdk).

@LeanBitLab LeanBitLab merged commit 82033c7 into LeanBitLab:main Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Capslock is activated with a single tap

2 participants